package com.vert.utils;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

/**
 * @Classname PropertiesUtils
 * @Description TODO
 * @Date 2022/5/26 16:10
 * @Created by XiongXiong
 * @Author: X.I.O
 */
public class PropertiesUtils {

    private static Map<String,String> properties=new HashMap<>();

    public void init(){
      try {
            Properties properties = new Properties();
            properties.load(this.getClass().getClassLoader().getResourceAsStream("application.properties"));
            properties.forEach((k,v)->{
                PropertiesUtils.properties.put(String.valueOf(k), String.valueOf(v));
            });
        }catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static String getProperty(String key) {
        return PropertiesUtils.properties.get(key);
    }


}
